Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Language Guide / Part 1 - Introducing AppleScript
Chapter 2 - Overview of AppleScript / Other Features and Language Elements


Case Sensitivity

AppleScript is not case sensitive; when it interprets statements in a script, it does not distinguish uppercase from lowercase letters. This is true for all elements of the language.

The one exception to this rule is string comparisons. Normally, AppleScript does not distinguish uppercase from lowercase letters when comparing strings, but if you want AppleScript to consider case, you can use a special statement called a Considering statement. For more information, see "Considering and Ignoring Statements" on page 213.

Most of the examples in this chapter and throughout this guide are in lowercase letters. Sometimes words are capitalized to improve readability. For example, in the following variable assignment, the "N" in myName is capitalized to make it easier to see that two words have been combined to form the name of the variable.

set myName to "Pegi"
After you create the variable myName, you can refer to it by any of these names:

MYNAME
myname
MyName
mYName
When interpreting strings, such as "Pegi", AppleScript preserves the case of the letters in the string, but does not use it in comparisons. For example, the value of the variable myName defined earlier is always "Pegi", but the value of the expression myName = "PEGI" is true.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996